package com.prs.crm.dao.flow;

import java.util.Collection;
import java.util.List;

import com.prs.crm.dao.BaseDao;
import com.prs.crm.domain.flow.WorkFlow;
import com.prs.crm.domain.flow.WorkFlowNode;
import com.prs.crm.domain.flow.WorkFlowTransition;

public interface WorkFlowDao  extends BaseDao<WorkFlow>{

	/**
	 *根据状态查找WorkFlow
	 * @param state
	 * @return
	 */
	Collection<WorkFlow> findByState(final Integer state);
	WorkFlowNode exists(WorkFlow workflow,final WorkFlowNode node);
	WorkFlowTransition exists(WorkFlow workflow,final WorkFlowTransition transition);
	void saveFlowNode(WorkFlowNode node);
	void removeNode(WorkFlowNode node);
	void removeTransition(WorkFlowTransition trans);
	List<WorkFlow> getWorkFlow(String type);
	List<WorkFlow> getAllWorkFlow();
}
